/c/Python33/Python.exe deploy.py
read asd;
exit 1;
inst=162mhc

ccdir="E:\Documentos\programacion\computercraft"
#
case $inst in
	1.4.7)
		ftbdir="E:\Aplicaciones\FTB\MindCrack\minecraft\saves\New World"
	;;
	1.5.1)
		ftbdir="E:\Aplicaciones\MultiMC\instances\1.5.1\minecraft\saves\OP World"
	;;
	1.5.2)
		ftbdir="E:\Aplicaciones\MultiMC\instances\1.5.2_2\minecraft\saves\OP World"
	;;
	152wgt)
		ftbdir="E:\Aplicaciones\FTB\152wgt\minecraft\saves\Asdland"
	;;
	152wgttest)
		ftbdir="E:\Aplicaciones\FTB\152wgt\minecraft\saves\Testing"
	;;
	152wgt2)
		ftbdir="E:\Aplicaciones\FTB\152wgt\minecraft\saves\New World"
	;;
	162mhc)
		ftbdir="E:\Aplicaciones\Minecraft\MHC\saves\Mega HardCore"
	;;
esac

function install-server(){
	echo "Installing server scripts in computer id $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	cp "$ccdir\\master_server.lua" "$ftbdir\\computer\\$1\\master_server"
}

function install-libs(){
	echo "Installing libraries in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	if [ ! -d "$ftbdir\\computer\\$1\\lib" ]; then
		mkdir -p "$ftbdir\\computer\\$1\\lib"
	fi
	for lib in turtle_utils serialize status state_machine; do
		cp "$ccdir\\libs\\$lib.lua" "$ftbdir\\computer\\$1\\lib\\$lib.lua"
	done
}

function install-turtle(){
	echo "Installing turtle scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in fill mine mine2 mine3 refuel status startup mine3; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
}

function install-farmer(){
	echo "Installing farmer scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in farm harvest startup; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
}

function install-builder(){
	echo "Installing turtle scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in build_railway; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
}

function install-blaze_killer(){
	echo "Installing blaze_killer scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in farm_blazes; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
}

function install-beekeeping(){
	echo "Installing bee keeper scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in farm_apiary; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
}

function install-elevator-control(){
	echo "Installing elevator control scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in elevator_control; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
	echo 'shell.run("elevator_control")' > "$ftbdir\\computer\\$1\\startup"

}

function install-elevator-floor(){
	echo "Installing elevator floor scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in elevator_floor; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
	echo 'shell.run("elevator_floor")' > "$ftbdir\\computer\\$1\\startup"
}

function install-elevator-repeater(){
	echo "Installing elevator repeater scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in elevator_repeater; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
	echo 'shell.run("elevator_repeater")' > "$ftbdir\\computer\\$1\\startup"
}

function install-quary(){
	echo "Installing quary control scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in frame_quary; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
	echo '' > "$ftbdir\\computer\\$1\\startup"
}

function install-api(){
	echo "Installing api scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1\\api" ]; then
		mkdir -p "$ftbdir\\computer\\$1\\api"
	fi
	for script in turtle_utils redpath inventory logf; do
		cp "$ccdir\\api\\$script.lua" "$ftbdir\\computer\\$1\\api\\$script"
	done
}

function install-logger(){
	echo "Installing logger scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in logger; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
	echo '' > "$ftbdir\\computer\\$1\\startup"
}

function install-conveyor() {
	echo "Installing conveyor belt scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	for script in cnv; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\$1\\$script"
	done
	echo '' > "$ftbdir\\computer\\$1\\startup"
}

function install-quarry-master() {
	echo "Installing quarry master scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	cp "$ccdir\\quarry_master2.lua" "$ftbdir\\computer\\$1\\qm"
}

function install-chest-monitor() {
	echo "Installing chest monitor scripts in computer $1"
	if [ ! -d "$ftbdir\\computer\\$1" ]; then
		mkdir -p "$ftbdir\\computer\\$1"
	fi
	if [ ! -d "$ftbdir\\computer\\$1\\api" ]; then
		mkdir -p "$ftbdir\\computer\\$1\\api"
	fi
	cp "$ccdir\\chest_monitor.lua" "$ftbdir\\computer\\$1\\cm"
	cp "$ccdir\\api\\json.lua" "$ftbdir\\computer\\$1\\api\\json"
}

function install-disk-quarry-setup(){
	echo "Installing quarry setup scripts in disk $1"
	if [ ! -d "$ftbdir\\computer\\disk\\$1" ]; then
		mkdir -pv "$ftbdir\\computer\\disk\\$1"
	fi
	if [ ! -d "$ftbdir\\computer\\disk\\$1\\lib" ]; then
		mkdir -pv "$ftbdir\\computer\\disk\\$1\\lib"
	fi
	if [ ! -d "$ftbdir\\computer\\disk\\$1\\api" ]; then
		mkdir -pv "$ftbdir\\computer\\disk\\$1\\api"
	fi
	for script in mine3 quarry_setup; do
		cp "$ccdir\\$script.lua" "$ftbdir\\computer\\disk\\$1\\$script"
	done
	for lib in serialize status state_machine; do
		cp "$ccdir\\libs\\$lib.lua" "$ftbdir\\computer\\disk\\$1\\lib\\$lib.lua"
	done
	for script in turtle_utils logf inventory; do
		cp "$ccdir\\api\\$script.lua" "$ftbdir\\computer\\disk\\$1\\api\\$script"
	done
	echo 'shell.run("/disk/quarry_setup")' > "$ftbdir\\computer\\disk\\$1\\startup"
}


case $inst in
	1.4.7)
		install-libs 31
		install-turtle 31
		install-farmer 31

		install-libs 37
		install-turtle 37
		install-builder 37

		install-libs 39
		install-server 39

		install-libs 41
		install-turtle 41
		install-builder 41

		install-libs 42
		install-farmer 42

		install-libs 44
		install-turtle 44

		install-libs 46
		install-turtle 46

		install-libs 50
		install-turtle 50

		install-libs 51
		install-turtle 51

		install-libs 52
		install-turtle 52

		install-libs 53
		install-turtle 53
		install-builder 53

		install-libs 54
		install-turtle 54
		install-beekeeping 54

		install-blaze_killer 45
		install-blaze_killer 55
		install-blaze_killer 56
		install-blaze_killer 57

		install-elevator-control 58
		install-elevator-floor 60
		install-elevator-repeater 61
		install-elevator-floor 62
		install-elevator-floor 63
		install-elevator-floor 64
		install-elevator-floor 65

		install-libs 59
		install-quary 59
	;;
	1.5.1)
		install-libs 0
		install-turtle 0
	;;
	1.5.2)
		install-libs 0
		install-turtle 0
		
		install-api 1
		install-logger 1
		install-api 2
		install-logger 2
		install-api 3
		install-logger 3
		install-api 4
		install-logger 4
		install-api 5
		install-logger 5
		install-api 6
		install-logger 6
		install-api 7
		install-logger 7
		install-api 8
		install-logger 8
		
		install-api 9
		install-conveyor 9
	;;
	152wgt)
		install-quarry-master 1
		
		install-chest-monitor 2

		install-libs 3
		install-turtle 3
		
		install-libs 4
		install-turtle 4
		install-api 4

		install-libs 7
		install-turtle 7
		install-api 7
		
		install-libs 9
		install-turtle 9
		install-api 9
		
		install-libs 10
		install-turtle 10
		install-api 10
		install-libs 11
		install-turtle 11
		install-api 11
		install-libs 12
		install-turtle 12
		install-api 12
		install-libs 13
		install-turtle 13
		install-api 13
		install-libs 14
		install-turtle 14
		install-api 14
		install-libs 15
		install-turtle 15
		install-api 15
		
		install-disk-quarry-setup 1
		install-api 1
	;;
	152wgttest)
		install-quarry-master 3
		install-api 3
	;;
	152wgt2)
		install-quarry-master 0
		install-api 0

		install-disk-quarry-setup 1

		install-api 2
		install-libs 2
		install-turtle 2

		install-api 3
		install-libs 3
		install-turtle 3

		install-api 10
		install-libs 10
		install-turtle 10

		install-api 11
		install-libs 11
		install-turtle 11

		install-api 12
		install-libs 12
		install-turtle 12

		install-api 13
		install-libs 13
		install-turtle 13

		install-api 14
		install-libs 14
		install-turtle 14

		install-api 15
		install-libs 15
		install-turtle 15

		install-api 16
		install-libs 16
		install-turtle 16

		;;
	162mhc)
		install-disk-quarry-setup 1

		install-api 0
		install-libs 0
		install-turtle 0
		install-api 1
		install-libs 1
		install-turtle 1
		install-api 2
		install-libs 2
		install-turtle 2
		;;
esac
#read asd